package cool.lichuan.project.system.controller;

import cool.lichuan.common.domain.Result;
import cool.lichuan.project.common.BaseController;
import cool.lichuan.project.system.domain.User;
import cool.lichuan.project.system.service.UserService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author lichuan
 * @date 2021/11/24 16:08
 * @description
 */
@RestController
@RequiredArgsConstructor
@RequestMapping("/sys/user")
public class UserController extends BaseController {
    private final UserService userService;

    @PostMapping("/add")
    public Result<Object> addUser(User user) {
        return toResult(userService.saveUser(user));
    }
}
